from flask import Flask, jsonify, request
# 导入配制文件
from config import Config
from flask_cors import CORS

import json

app = Flask(__name__)
# 加载配制文件
app.config.from_object(Config)
# 跨域配制
CORS(app)


def get_data():
    data = request.data
    if data:
        data = json.loads(data)
    else:
        data = request.form
    return data


if __name__ == "__main__":
    app.run(host='127.0.0.1',port='5001')
